<div id="content">
	<div class="row s_page_title">
		<sa-big-breadcrumbs [items]="['项目管理','项目事件记录']" icon="fa fa-smile-o" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
	</div>
	<sa-widgets-grid>
		<div class="s_table">
			<div sa-widget [editbutton]="false" color="darken" class="clearfix">
				<header><span class="widget-icon"> <i class="fa fa-table"></i> </span><h2>项目事件记录</h2></header>
				<div>
					<div class="widget-body no-padding">
						<div class="page-header clearfix s_table_opreation">
							<div class="left page-header-btn">
							    <div class="top_module">
                                    <span class="module_text">项目名称</span>
                                    <sa-company-tree companyTreeId="companyTree" (companySelected)="companySelected($event)"></sa-company-tree>
                                </div> 
								<div class="top_module top_module_box">
                                    <span class="top_module_label module_text">投诉类型</span>
                                    <select name="" class="top_module_select" [(ngModel)]="tableParam.type">
                                        <option value="">全部</option>
                                        <option value="0">客户</option>
                                        <option value="1">内部</option>
                                    </select>
                                </div>
                                <div class="top_module top_module_box">
                                    <span class="top_module_label module_text">投诉分类</span>
                                    <select name="" class="top_module_select" [(ngModel)]="tableParam.sort">
                                        <option value="">全部</option>
                                        <option value="0">硬件</option>
                                        <option value="1">平台</option>
                                        <option value="2">APP</option>
                                        <option value="3">算法</option>
                                        <option value="4">实施</option>
                                    </select>
                                </div>
								<div class="top_module top_module_box">
                                    <span class="top_module_label module_text">是否解决</span>
                                    <select name="" class="top_module_select" [(ngModel)]="tableParam.status">
                                        <option value="">全部</option>
                                        <option value="1">已解决</option>
                                        <option value="0">未解决</option>
                                    </select>
                                </div>
								<div class="selectDate top_module">
									<table-select-date [notInit]='true' (outerTime)="getSelectTableTime($event)"  [specifyTime]='initDateRange' [minDay]='true'></table-select-date>
								</div>
								<button type="button" class="btn btn-primary" (click)="table_search()">查询</button>
								<button type="button" class="btn btn-primary" (click)="showAddUserModal()">添加</button>
							</div>
							<div class="right top-search">
								<input type="text" [(ngModel)]="tableParam.searchKey" (change)="table_search()" class="search-input" placeholder="项目名称、原因分析">
								<span class="top-search-box">
							        <button class="top-search-btn" type="button" (click)="table_search()"> <i class="fa fa-search"></i></button>
							    </span>
							</div>
						</div>
						<div class="table_scroll">
							<table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
								<thead>
									<tr>
										<th>项目名称</th>
										<th>事件描述</th>
										<th>投诉类型</th>
										<th>投诉分类</th>
										<th>是否解决</th>
										<th>责任人</th>
										<th>解决过程</th>
										<th>解决时间</th>
										<th>原因分析</th>
										<th>相关图片</th>
										<th>事件时间</th>
										<th>最后操作人</th>
										<th>最后操作时间</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
									<tr *ngFor="let row of tableData" >
										<td>{{row.companyName}}</td>
										<td>{{row.eventDesc}}</td>
										<td>
										    <span *ngIf="row.type == 0">客户</span>
										    <span *ngIf="row.type == 1">内部</span>
										</td>
										<td>
										    <span *ngIf="row.sort == 0">硬件</span>
                                            <span *ngIf="row.sort == 1">平台</span>
                                            <span *ngIf="row.sort == 2">APP</span>
                                            <span *ngIf="row.sort == 3">算法</span>
                                            <span *ngIf="row.sort == 4">实施</span>
										</td>
										<td>
										    <span *ngIf="row.status == 0" class="red">未解决</span>
                                            <span *ngIf="row.status == 1" class="green">已解决</span>
										</td>
										<td>{{row.principal}}</td>
										<td>{{row.solveCourse}}</td>
										<td>{{row.resolutionTime}}</td>
										<td>{{row.reason}}</td>
										<td>
                                            <button *ngIf="row.imagePath" type="button" (click)="showImg1(row,imgModal)">查看</button>
                                        </td>
										<td>{{row.eventTime}}</td>
										<td>{{row.updateUser}}</td>
										<td>{{row.updateTime}}</td>
										<td>
											<button type="button" (click)="editRow(row)">编辑</button>
											<button type="button" (click)="delRow(row)">删除</button>
										</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div class="table-fix clearfix">
							<paginator [totalRecords]="totalCount"
						           [rows]="pageSize"
						           [currentPage]="curPage - 1"
						           (onPageChange)="paginate($event)">
							</paginator>
							<button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</sa-widgets-grid>
</div>

<!-- 新增项目车辆   弹窗-->
<section id="projectEventModal" class="modal fade" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true" data-backdrop="static" data-keyboard="false">
	<div class="modal-dialog modal-lg">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" (click)="closeProjectEventModal()" aria-label="Close"><span aria-hidden="true">&times;</span></button>     
				<h4 class="modal-title"><span *ngIf="formType == 'add'">新增</span><span *ngIf="formType == 'update'">编辑</span>项目事件</h4>
			</div>
			<form id="projectEventForm"  class="form-horizontal" role="form" novalidate="novalidate" [saBootstrapValidator]="validatorOptions">
				<div class="modal-body">
					<div class="row form-horizontal">

						<div class="form-group col-xs-12">
							<label class="control-label col-xs-3">项目名称<sup>*</sup></label>
							<div class="col-xs-9">
							    <sa-company-tree companyTreeId="companyTreeForm" [Height]="32" [companyNameValue]="eventForm.companyName" [companyIdValue]="eventForm.companyId" (companySelected)="companySelectedForm($event)"></sa-company-tree>
							</div>
						</div>
                        <div class="form-group col-xs-12">
                            <label class="control-label col-xs-3">事件描述<sup>*</sup></label>
                            <div class="col-xs-9" >
								<textarea class="handleInfo form-control " name="eventDesc" [(ngModel)]="eventForm.eventDesc" cols="30" placeholder="描述" rows="4"></textarea>
                            </div>
                        </div>
						<div class="form-group col-xs-12">
							<label class="control-label col-xs-3">投诉类型<sup>*</sup></label>
							<div class="col-xs-9" >
								<select name="type" class="form-control" [(ngModel)]="eventForm.type">
                                    <option value="">请选择</option>
                                    <option value="0">客户</option>
                                    <option value="1">内部</option>
                                </select>
							</div>
						</div>
						<div class="form-group col-xs-12">
							<label class="control-label col-xs-3">投诉分类<sup>*</sup></label>
							<div class="col-xs-9" >
								<select name="sort" class="form-control" [(ngModel)]="eventForm.sort">
                                    <option value="">请选择</option>
                                    <option value="0">硬件</option>
                                    <option value="1">平台</option>
                                    <option value="2">APP</option>
                                    <option value="3">算法</option>
                                    <option value="4">实施</option>
                                </select>
							</div>
						</div>
						<div class="form-group col-xs-12">
							<label class="control-label col-xs-3">是否解决<sup>*</sup></label>
							<div class="col-xs-9" >
								<select name="status" class="form-control" [(ngModel)]="eventForm.status">
                                    <option value="">请选择</option>
                                    <option value="0">未解决</option>
                                    <option value="1">已解决</option>
                                </select>
							</div>
						</div>
						<div class="form-group col-xs-12">
                            <label class="control-label col-xs-3">原因分析</label>
                            <div class="col-xs-9" >
                                <input class="form-control" name="reason"  [(ngModel)]='eventForm.reason' placeholder="原因" />
                            </div>
                        </div>
						<div class="form-group col-xs-12">
                            <label class="control-label col-xs-3">解决过程</label>
                            <div class="col-xs-9" >
                                <input class="form-control" name="solveCourse"  [(ngModel)]='eventForm.solveCourse' placeholder="解决过程" />
                            </div>
                        </div>
						<div class="form-group col-xs-12">
                            <label class="control-label col-xs-3">责任人</label>
                            <div class="col-xs-9" >
                                <input class="form-control" name="principal"  [(ngModel)]='eventForm.principal' placeholder="责任人" />
                            </div>
                        </div>
						<div class="form-group col-xs-12">
                            <label class="control-label col-xs-3">解决时间</label>
                            <div class="col-xs-9" >
                                <input class="form-control" name="resolutionTime" autocomplete="off" id="resolutionTime" [(ngModel)]='eventForm.resolutionTime' placeholder="时间" />
                            </div>
                        </div>
						<div class="form-group col-xs-12">
                            <label class="control-label col-xs-3">事件时间<sup>*</sup></label>
                            <div class="col-xs-9" >
                                <input class="form-control" name="eventTime" autocomplete="off" id="eventTime" [(ngModel)]='eventForm.eventTime' placeholder="时间" />
                            </div>
                        </div>
						<div class="form-group col-xs-12">
							<label class="control-label col-xs-3 no-padding-right">相关图片</label>
							<div class="col-xs-9">
								<div class="imgFileList">
									<div class="imgFileList-other">
										<div class="imgFileList-multifile">
											<div class="uploadlocation uploadlocation1"> 
												<div class="content-list">
													<div class="headImg" *ngFor="let item of imageInfo.imageList; let i = index">
														<div class="contentImg"><img class="img" alt="项目事件相关图片"  [src]="item" (click)="bigImgClick()"></div>
															<i class="deleteImg" (click)="deleteImg('1',i)"></i>
													</div>
													<button type="button"  class="btn div_imgall">
														<div class="div_shuline"></div>
														<div class="div_hengline"></div>
														<input type="file" class="up" title=" " placeholder=" "  multiple (change)="multifileChange($event.target.files)"/>
													</button>
												</div>
											</div>
										</div>
									</div>
								</div>
							</div>
						</div>

					</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" (click)="closeProjectEventModal()">取消</button>
					<button type="button" class="btn btn-primary" (click)="projectEventSubmit()">确认</button>
				</div>
			</form>
		</div>


	</div>
</section>
<!-- 新增项目车辆 弹窗end-->

<!-- 图片查看   弹窗-->
<section bsModal #imgModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
	<div class="modal-dialog modal-lg">
		<div class="modal-content" style="width: 570px;">
			<div class="modal-header">
				<button type="button" class="close" (click)="closeImgModal1(imgModal)" aria-label="Close"><span aria-hidden="true">&times;</span></button>     
				<h4 class="modal-title">图片</h4>
			</div>
			<div class="modal-body">
				<div class="imagesInfo1">
					<div class="imgShow" *ngFor="let item of imgLocalList" (click)="bigimg()">
						<img [src]="item" alt="项目事件相关图片"  style="cursor: pointer;"/>
					</div>
				</div>
			</div>
		</div>
	</div>
</section>
<!-- 图片查看 弹窗end-->